home *** CD-ROM | disk | FTP | other *** search
- /***********************************************************************
- *
- * Scan.c (Main Program)
- *
- * Copyright (c)
- * Apple Computer, Inc. 1986-1989
- * All Rights Reserved.
- *
- * This file contains the scanner program.
- *
- ***********************************************************************/
-
- #include <types.h>
- #include <quickdraw.h>
- #include <qdaux.h>
- #include <window.h>
- #include <locator.h>
- #include <texttool.h>
- #include <intmath.h>
- /* Include this line to use Tool039 (the Scanner Toolset)
- #include "scToolSet.h"
- */
-
- main()
- {
- Ref initRef; /* This holds the reference to the startstop record */
- char errBuf[5];
-
- initGlobals(); /* Initialize our globals. */
-
- TLStartUp(); /* start up the tool locator */
-
- /* Startup the tools using the new toolbox call */
- initRef = StartUpTools(_ownerid, refIsResource, 0x0001L);
- if (!_toolErr) {
- #ifdef __scToolSet__
- LoadOneTool(39, 1); /* load the Scanner toolset */
- if(_toolErr) {
- InitCursor();
- ErrorWindow(0,NULL,_toolErr);
- WaitCursor();
- } else if(findScanner()) { /* find the device number of the scanner */
- #else
- if(findScanner()) { /* find the device number of the scanner */
- #endif
- setupMenus(); /* Set up menus */
- setupWindows();
- InitCursor(); /* Make cursor show ready */
- mainEvent(); /* Use application */
- #ifdef __scToolSet__
- scShutDown(); /* shut down the scanner toolset */
- UnloadOneTool(39);
- #endif
- }
- ShutDownTools(refIsHandle, initRef);
- /* Let the toolbox shutdown the tools. */
- } else {
- Int2Hex(_toolErr, &errBuf[1], 4);
- errBuf[0] = 4;
- WriteLine("\pUnable to start toolsets.");
- WriteCString("Error code = $");
- WriteLine(errBuf);
- WriteLine("\pPress any key to quit...");
- ReadChar(0);
- }
-
- TLShutDown();
- /* qFlags = 0x4000; /* we can be restarted from memory */
- }